<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>储值充值</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_memberAdd.css">
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
</head>

<body>
	<div class="page_wraper">
		<div id="tab1_0" fortab="tab1">
			<form action="{:U('Vipcard/changeCard')}" method="post" id="changeCard_form">
			<input type="hidden" name="customid" id="customid" value="{$detail.id}">
			<input type="hidden" name="vipno" id="vipno" value="{$detail.vipno}">
			<table cellpadding="0" cellspacing="0" class="module_form" width="600">
			<fieldset>
				<tr>
					<td class="ele_title"><label for="cardnum">会员卡号：<em>*</em></label></td>
					<td class="ele_content">
						<input value="{$detail.vipno}" name="vipno" type="text" id="vipno" class="form_ele_text width_150">
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="cardnum">充值金额(元)：<em>*</em></label></td>
					<td class="ele_content">
						<input name="money" type="text" id="money" class="form_ele_text width_150">
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="remark">备注：</label></td>
					<td class="ele_content">
						<textarea name="remark" cols="" rows="" id="remark"></textarea></td>
				</tr>
			</table>
			</form>
		</div>
		
	</div>
	<div class="page_footer pdtd10">
		<input type="button" name="submit" value="确定"  class="form_ele_submit"/>
		<input type="reset" name="reset" value="取消"  class="form_ele_reset"/>
	</div>
</body>
<script type="text/javascript">
	//弹出窗口全局变量
	var api = frameElement.api, W = api.opener;

	$(function(){
		//滑动门
		$('.tabbar li').click(function(){
			var tabname = $('.tabbar>ul').attr('tabname');
			$('.tabbar li').removeClass('tabhover');
			$(this).addClass('tabhover');
			
			$('div[fortab="'+tabname+'"]').hide();
			$('#'+$(this).attr('show')).show();
		});
		
		//表格隔行换色
		$('.module_form tr:odd').addClass('odd');
		$('.module_form tr:even').addClass('even');
		
		//表单操作
		//重置
		$('.form_ele_reset').on('click',function(){
			//$('#memberAdd_form').get(0).reset();
			frameApi.close(); //关闭当前窗口
		});
		
		//提交
		$('.form_ele_submit').on('click',function(){
			//通过POST直接提交表单
			//$('#memberAdd_form').get(0).submit();
			//etcommon.maskShow();
			
			var tipsObj = windowApi.lhgdialog.tips('正在提交数据...',10,etIcon.loading);
			
			//通过Ajax提交表单
			var postData = {};
			postData.vipno    = $('#vipno').val(); //会员卡号
			postData.customid = $('#customid').val(); //会员信息id
			postData.money    = $('#money').val(); //充值金额
			postData.remark   = $('#remark').val(); //备注信息
			
			//console.log(postData);
			
			$.post("{:U('Vipcard/rechargeMoney')}", postData ,
				function(data){
					tipsObj.close();
					if(data.status==1){
						windowApi.lhgdialog.tips('储值充值成功！',2,etIcon.success,function(){
							var obj = windowApi.lhgdialog.list['Custom_detail'];
							obj.reload(obj); //指定刷新某个窗口
						});	
					}else{
						windowApi.lhgdialog.tips(data.info,2,etIcon.error);
					}
					frameApi.close(); //关闭当前窗口
				}, "json"
			);
		});
	});
</script>
</html>
